package com.multi.thread.chapter02.demo08.test01;

public class Service {
	
	public void testMethod(MyObject object) {
		synchronized (object) {
			try {
				System.out.println("testMethod_____getLock time = " + System.currentTimeMillis() 
						+ ", run ThreadName = " + Thread.currentThread().getName());
				Thread.sleep(2000);
				System.out.println("testMethod releaseLock time = " + System.currentTimeMillis() 
						+ ", run ThreadName = " + Thread.currentThread().getName());
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
 
}
